| Conditions | 4 |
| Paths | 5 |
| Total Lines | 30 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | /** |
||
| 12 | onKeyup: function(e) { |
||
| 13 | var query = this.$input.val().toLowerCase().replace(/[^\w\d\s]/g,''); |
||
| 14 | |||
| 15 | // The user's search query is longer than 0 characters |
||
| 16 | if(query.length > 0) { |
||
| 17 | |||
| 18 | var $matches = Amarkal.settings.fields.search(query); |
||
| 19 | |||
| 20 | // Store a copy of the active section before it is deactivated |
||
| 21 | if(null === this.activeSection) { |
||
| 22 | this.activeSection = Amarkal.settings.sections.activeSection; |
||
| 23 | } |
||
| 24 | |||
| 25 | Amarkal.settings.sections.deactivate(); |
||
| 26 | Amarkal.settings.header.setSectionTitle('Field Search Results'); |
||
| 27 | Amarkal.settings.header.setSectionSubtitle(''); |
||
| 28 | Amarkal.settings.fields.hideAll(); |
||
| 29 | Amarkal.settings.fields.show($matches); |
||
| 30 | |||
| 31 | // Textual user feedback |
||
| 32 | $('#settings-search-results').addClass('visible').text($matches.length ? $matches.length+' settings found' : 'Nothing found'); |
||
| 33 | } |
||
| 34 | |||
| 35 | // The user's search query is not longer than 0 character |
||
| 36 | else { |
||
| 37 | $('#settings-search-results').removeClass('visible').text(''); |
||
| 38 | Amarkal.settings.sections.activate(this.activeSection); |
||
| 39 | this.activeSection = null; |
||
| 40 | } |
||
| 41 | } |
||
| 42 | }; |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.